package com.kedi.archivescenter.service.impl;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kedi.archivescenter.service.PcOldManService;
import com.kedi.archivescenter.write.dao.mapper.PcOldManMapper;

/**
 * 
 * @Description:
 * @author: 陈辽逊
 * @date: 2019 2019年7月22日 下午1:23:56
 */
@Service
public class PcOldManServiceImpl implements PcOldManService {

	@Autowired
	public PcOldManMapper mapper;

	final static Logger logger = LoggerFactory.getLogger(PcOldManServiceImpl.class);

	/**
	 * 返回一个数据对象
	 * 
	 * @return oldmanpart
	 */
	@Override
	public List<Map<String, Object>> oldpart() {
		try {
			List<Map<String, Object>> a = mapper.oldmanpart();
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return null;
		}
	}

	/**
	 * 返回一个数据对象
	 * 
	 * @param elderlyid
	 * @return oldall
	 */
	@Override
	public List<Map<String, Object>> oldall(int elderlyid) {
		try {
			List<Map<String, Object>> a = mapper.oldmanall(elderlyid);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return null;
		}
	}

	/**
	 * 返回一个数据对象
	 * 
	 * @param map
	 * @return elderly
	 */
	@Override
	public int elderly(Map map) {
		try {
			int a = mapper.elderly(map);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("修改失败");
			return 0;
		}
	}

	/**
	 * 返回一个数据对象
	 * 
	 * @param map
	 * @return ielderly
	 */
	@Override
	public int ielderly(Map map) {
		try {
			int a = mapper.ielderly(map);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("修改失败");
			return 0;
		}
	}
}
